package org.code.mallspringboot.service.impl;

import org.code.mallspringboot.dto.SmsProductRelationListDto;
import org.code.mallspringboot.dto.SmsSelectProductsDto;
import org.code.mallspringboot.mapper.SmsFlashPromotionProductRelationMapper;
import org.code.mallspringboot.pojo.SmsFlashPromotionProductRelation;
import org.code.mallspringboot.service.SmsFlashPromotionProductRelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *
 */
@Service
public class SmsFlashPromotionProductRelationServiceImpl  implements SmsFlashPromotionProductRelationService{

    @Autowired
    private SmsFlashPromotionProductRelationMapper smsFlashPromotionProductRelationMapper;

    @Override
    public List<SmsProductRelationListDto> selectPage(Integer pageNum, Integer pageSize, Integer flashPromotionId, Integer flashPromotionSessionId) {
        return smsFlashPromotionProductRelationMapper.selectPage((pageNum - 1) * pageSize, pageSize, flashPromotionId, flashPromotionSessionId);
    }

    @Override
    public int total(Integer flashPromotionId, Integer flashPromotionSessionId) {
        return smsFlashPromotionProductRelationMapper.total(flashPromotionId, flashPromotionSessionId);
    }

    @Override
    public int update(SmsProductRelationListDto smsProductRelationListDto) {
        return smsFlashPromotionProductRelationMapper.update(smsProductRelationListDto);
    }

    @Override
    public int add(SmsSelectProductsDto smsSelectProductsDto) {
        return smsFlashPromotionProductRelationMapper.add(smsSelectProductsDto);
    }

    @Override
    public int delete(int id) {
        return smsFlashPromotionProductRelationMapper.delete(id);
    }
}




